﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using SystemX.Infrastructure;
using SalePoints.Models;

namespace SalePoints.Web.Webservices
{
	/// <summary>
	/// Summary description for SalePoint
	/// </summary>
	[WebService(Namespace = "http://asmx.m18.com")]
	[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
	[System.ComponentModel.ToolboxItem(false)]
	// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
	// [System.Web.Script.Services.ScriptService]
	public class SalePoint : System.Web.Services.WebService
	{
		/// <summary>
		/// 按时统计昨天、上周同期的数据。并保存于xml文件中(app_data/cache/SalePoints.Hourly.xml),同时至于缓存中
		/// </summary>
		/// <param name="statDateFlag"></param>
		/// <param name="msg"></param>
		[WebMethod]
		public void StatHourly(DateTime statDateFlag, out string msg)
		{
			msg = string.Empty;
			var boMsg = new BOMessager();
			BOSalePoint.StatHourly(statDateFlag, out boMsg);
			msg = boMsg.Body;
		}
		/// <summary>
		/// 按时统计当天每小时数据。结果至于缓存中。缓存键为:BOSalePoint.Hourly.Now.{当日(yyyyMMdd)}
		/// </summary>
		/// <param name="statDateFlag"></param>
		/// <param name="msg"></param>
		[WebMethod]
		public void StatHourlyToday(out string msg)
		{
			msg = string.Empty;
			var boMsg = new BOMessager();
			BOSalePoint.StatHourlyToday(out boMsg);
			msg = boMsg.Body;
		}

	}
}
